﻿<?PHP
class ObjectTransport{

	private $typeStr = null;
	private $titleStr = null;
	private $messageStr = null;
	private $actionStr = null;
	private $objectValue = null;
	private $validOperation = null;
	private $param = null;
	
	const ERROR = 'error';
	const SUCCESS = 'success';
	const ALERT = "warning";
	const INFO = "info";
	const FATAL_ERROR = "fatal error";
	const IS_VALID = 1;
	const IS_NOT_VALID = 0;

	public function getTypeStr(){
		return $this->typeStr;
	}

	public function setTypeStr($typeStr){
		$this->typeStr = $typeStr;
	}

	public function getTitleStr(){
		return $this->titleStr;
	}

	public function setTitleStr($titleStr){
		$this->titleStr = $titleStr;
	}

	public function getMessageStr(){
		return $this->messageStr;
	}

	public function setMessageStr($messageStr){
		$this->messageStr = $messageStr;
	}

	public function getActionStr(){
		return $this->actionStr;
	}

	public function setActionStr($actionStr){
		$this->actionStr = $actionStr;
	}

	public function getObjectValue(){
		return $this->objectValue;
	}

	public function setObjectValue($objectValue){
		$this->objectValue = $objectValue;
	}
	
	public function getValidOperation(){
		return $this->validOperation;
	}

	public function setValidOperation($validOperation){
		$this->validOperation = $validOperation;
	}
	
	public function getParam(){
		return $this->param;
	}

	public function setParam($param){
		$this->param = $param;
	}
	
	//executa a navegação
	public function executeNavigator(){
	
		$url = 'Location: index.php?f=';
		
		if($this->actionStr != null){
			$url = $url.$this->actionStr;
			
			if($this->param != null){
				$url = $url.$this->param;
			}
			
			if($this->titleStr != null || $this->messageStr != null){
				$url = $url.'&dialog_type="'.$this->titleStr.'"&dialog_msg="'.$this->messageStr.'"';
			}
		}
		header($url);	
	}
}

?>